How to pass array data from Laravel Inertia Js render method to child component from parent component in Vue 3? 您所在的位置:网站首页 vue laravel How to pass array data from Laravel Inertia Js render method to child component from parent component in Vue 3?

How to pass array data from Laravel Inertia Js render method to child component from parent component in Vue 3?

2023-04-17 17:22| 来源: 网络整理| 查看: 265

How to pass array data from Laravel Inertia Js render method to child component from parent component in Vue 3? 03 Apr, 2023 Programming 0

I’m having users’ array data and rendering this from route to Dashboard.vue component through inertia render method, where I’m unable to pass users data from Dashboard.vue component to Users.vue component.

Route::get('/dashboard', function () { $users = User::all(); return Inertia::render('Dashboard', ['users' => $users]); })->name('dashboard');

Dashbaord.vue parent component

//this one passing {{ $users }} as string data in props.

//this one getting syntax error.

Users.vue child component

Component Displayed

{{ title }}

{{ user.name }}

export default{ props:{ users:Array, title:String } }

Can anyone suggest to me how to pass array data from one component to another component in Vue js?



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有